﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AirLinq.Providers.Sql {
	public class SqlQuerySpecification : SqlQueryExpressionBase {
		private readonly SqlSelectCollectionBase _selectList;
		private readonly SqlSource _tableSource;
		private readonly SqlLogicalExpression _whereCaluse;
		private readonly SqlGroup _groupByClause;
		public SqlQuerySpecification(SqlSelectCollectionBase selectList, SqlSource tableSource, SqlLogicalExpression whereClause, SqlGroup groupByClause) {
			if (selectList == null) {
				throw new ArgumentNullException("selectList");
			}
			_selectList = selectList;
			_tableSource = tableSource;
			_whereCaluse = whereClause;
			_groupByClause = groupByClause;
		}
		public SqlSelectCollectionBase Columns {
			get {
				return _selectList;
			}
		}
		public SqlSource TableSource {
			get {
				return _tableSource;
			}
		}
		public SqlLogicalExpression WhereClause {
			get {
				return _whereCaluse;
			}
		}
		public SqlGroup GroupClause {
			get {
				return _groupByClause;
			}
		}
		public override SqlNodeType NodeType {
			get {
				return SqlNodeType.QuerySpecification;
			}
		}
	}
}
